Skip to content

Conversation

@maythamfahmi
Copy link
Collaborator

This pull request introduces several improvements to project configuration, dependency updates, and packaging for the CryptoNet solution. The most significant changes include updating package versions across projects, enhancing packaging settings to ensure referenced DLLs are included, and improving build determinism and repository metadata. Additionally, a new script for NuGet package validation has been added.

Project packaging and build enhancements:

  • Added new properties to CryptoNet.ExtShared.csproj and CryptoNet.Models.csproj to improve build determinism, embed source information, and publish repository metadata. Both projects are now marked as non-packable. ([[1]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-2820ddecfe8f253dbb58d712aae135fd67cc54702ba4798c705a0409018f41b8L7-R14), [[2]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-e0f187609799ca11b78009eacde193a2cb2ec597bf0e615edab42abc65510957R7-R14))
  • Updated CryptoNet.csproj to embed debug symbols, include referenced projects in the NuGet package, and ensure referenced DLLs (CryptoNet.ExtShared and CryptoNet.Models) and their symbols/XML docs are packaged. ([[1]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-54e2fb4c172a31238f950dd666a680b4b9166f05793de767138ae5539740d8ddR30-R36), [[2]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-54e2fb4c172a31238f950dd666a680b4b9166f05793de767138ae5539740d8ddR67-R96))
  • Improved versioning and path mapping logic in Directory.Build.Props, including conditional PathMap assignment and setting the solution version to 3.2.0. ([Directory.Build.PropsR6-R19](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-5323a65ea4b70b65445c9a38859ddfc2e5263e438a8696baa6ba3bb5b081927eR6-R19))

Dependency updates:

  • Updated System.Text.Json to version 10.0.0 across all projects and examples. ([[1]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-54e2fb4c172a31238f950dd666a680b4b9166f05793de767138ae5539740d8ddL49-R51), [[2]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-0a6c7698b1a30d87fab84f5d7c58c9bab09e7857e6e3fe76317bb3418273e777L12-R12), [[3]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-a92b7092e768824400120a9c191fa946d4554faf706d8b554ee8712e77575c26L12-R12), [[4]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-ebccbb7c861eaa7a3492def48c4ca0c3bd6c3e52f29089324b2509f7e2ea4475L11-R11), [[5]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-11f4582df1fe471cf4d8158f9482a7f09fb5f39012711f875fe2a4ff81472602L16-R29), [[6]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-462aff19663cad5fc0764c06cee9f1af946d455cb1f8e705aaf1bea024b84fe4L26-R34))
  • Bumped several test and utility dependencies in CryptoNet.UnitTests and Examples.UnitTests, including Microsoft.NET.Test.Sdk, NUnit3TestAdapter, SharperHacks.CoreLibs.IO, and ReportGenerator. ([[1]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-11f4582df1fe471cf4d8158f9482a7f09fb5f39012711f875fe2a4ff81472602L16-R29), [[2]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-462aff19663cad5fc0764c06cee9f1af946d455cb1f8e705aaf1bea024b84fe4L17-R17), [[3]](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-462aff19663cad5fc0764c06cee9f1af946d455cb1f8e705aaf1bea024b84fe4L26-R34))

Build and validation tooling:

  • Added a run_nuget_validation.ps1 script for validating local NuGet packages using dotnet-validate. ([run_nuget_validation.ps1R1-R7](https://github.com/itbackyard/CryptoNet/pull/155/files#diff-63ae9f771c14ec6c39498f5e2ebbda020cad41863b64143392d1917be1cf2f85R1-R7))

These changes collectively improve the reliability, traceability, and maintainability of the build and packaging process for the CryptoNet solution.

- Set `<IsPackable>false</IsPackable>` in `CryptoNet.ExtShared.csproj`
  and `CryptoNet.Models.csproj` to prevent NuGet packaging.
- Bump version in `CryptoNet.csproj` from `3.0.0` to `3.1.9`.
- Add `<IncludeReferencedProjects>true</IncludeReferencedProjects>`
  to include referenced project outputs in the NuGet package.
- Add a target to explicitly include referenced DLLs in the package.
- Modify asset handling for `CryptoNetLogo-icon.png` to prevent
  copying to the output directory.
- Update `Directory.Build.Props` to conditionally set `<PathMap>`
  only when `$(SolutionDir)` is defined, avoiding malformed paths.
- Upgraded `Microsoft.CodeAnalysis.NetAnalyzers` to `10.0.100`.
- Upgraded `System.Text.Json` to `10.0.0` across all projects.
- Updated test dependencies: `Microsoft.NET.Test.Sdk`, `NUnit3TestAdapter`,
  `ReportGenerator`, `SharperHacks.CoreLibs.IO`, `CliWrap`, and `NUnit.Analyzers`.
- Added `Microsoft.Build` to `CryptoNet.UnitTests.csproj`.
- Enabled embedded debugging with `<DebugType>embedded</DebugType>`.
- Re-enabled `<GenerateDocumentationFile>` in `CryptoNet.csproj`.
- Centralized versioning in `Directory.Build.Props` and set version to `3.2.0`.
- Updated `TargetFramework` to `net8.0` in `Directory.Build.Props`.
- Adjusted project references and metadata for consistency.
- Set `<IsPackable>false</IsPackable>` in `CryptoNet.ExtShared.csproj`
  and `CryptoNet.Models.csproj` to prevent standalone NuGet packing.
- Added `<DebugType>portable</DebugType>` and `<Deterministic>true</Deterministic>`
  for portable PDBs and deterministic builds.
- Downgraded `Microsoft.CodeAnalysis.NetAnalyzers` to 9.0.0 and
  `System.Text.Json` to 9.0.8 in `CryptoNet.ExtShared.csproj` for compatibility.
- Included `.pdb` and `.xml` files for `CryptoNet.ExtShared` and
  `CryptoNet.Models` in the NuGet package if they exist.
- Added NuGet validation script in `run_nuget_validation.ps1` to
  ensure package quality using `dotnet-validate`.
Updated project files to improve NuGet packaging and SourceLink integration:
- Added `<IsPackable>false</IsPackable>` to prevent standalone NuGet packaging.
- Included repository metadata (`<RepositoryUrl>` and `<PublishRepositoryUrl>`).
- Enabled SourceLink and deterministic build settings with `<EmbedUntrackedSources>` and `<ContinuousIntegrationBuild>`.

Refined dependencies:
- Added `Microsoft.SourceLink.GitHub` (v8.0.0) for GitHub SourceLink support.
- Retained `Microsoft.CodeAnalysis.NetAnalyzers` (v9.0.0) for static analysis.

Removed obsolete properties and comments:
- Removed `_SkipUpgradeNetAnalyzersNuGetWarning` and outdated comments.

Updated `run_nuget_validation.ps1`:
- Added `dotnet clean`, `dotnet build`, and `dotnet pack` commands.
- Integrated `dotnet-validate` for NuGet package validation.
Removed `<DebugType>portable>`, `<Deterministic>`,
`<ContinuousIntegrationBuild>`, and `<EmbedUntrackedSources>`
from `CryptoNet.ExtShared.csproj` and `CryptoNet.Models.csproj`.
These changes simplify the build configuration by removing
explicit settings for debug information, deterministic builds,
CI build flags, and SourceLink validation. Adjustments may
reflect a shift to default or external configurations.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses assembly loading issues (bugfix #154) by improving NuGet packaging to include referenced DLLs (CryptoNet.ExtShared and CryptoNet.Models) directly in the CryptoNet package. The changes also update dependencies across all projects and enhance build reproducibility through improved version management and deterministic build settings.

  • Implements custom MSBuild target to package internal dependency DLLs with symbols and XML documentation
  • Updates multiple package dependencies to newer versions (including System.Text.Json, test SDKs, and analyzers)
  • Centralizes version management in Directory.Build.Props and adds build reproducibility properties

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
run_nuget_validation.ps1 Adds PowerShell script to automate NuGet package validation using dotnet-validate tool
Directory.Build.Props Centralizes version to 3.2.0 and adds conditional PathMap to prevent malformed pathmap warnings
CryptoNet/CryptoNet.csproj Adds custom MSBuild target to include referenced project DLLs in package, updates dependencies, and configures embedded debug symbols
CryptoNet.Models/CryptoNet.Models.csproj Marks as non-packable and adds repository metadata and deterministic build properties
CryptoNet.ExtShared/CryptoNet.ExtShared.csproj Marks as non-packable and adds repository metadata and deterministic build properties
CryptoNet.UnitTests/CryptoNet.UnitTests.csproj Updates test framework and dependency versions
Examples/Examples.UnitTests/Examples.UnitTests.csproj Updates test framework and dependency versions
Examples/AESExample/AESExample.csproj Updates System.Text.Json version
Examples/DSAExample/DSAExample.csproj Updates System.Text.Json version
Examples/RSAExample/RSAExample.csproj Updates System.Text.Json version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maythamfahmi maythamfahmi merged commit c557ae9 into main Nov 29, 2025
10 checks passed
@maythamfahmi maythamfahmi deleted the feature/#154-bugfix-Could-not-load-file-or-assembly branch November 29, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants